<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title></title>
</head>
<body>
<p>

<script type="text/javascript">
document.write("<h1>This is a heading</h1>");
document.write("<p>This is a paragraph.</p>");
</script>

<p>
只能在HTML输出流中使用<strong>document.write</strong>.
如果在文档已加载后使用它(比如在函数中),会覆盖整个文档
</p>

</p>
</body>
</html>
